﻿using System.Collections;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace SiteFox.WebParts.Standard
{
    [AspNetHostingPermission(SecurityAction.Demand,
      Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand,
      Level = AspNetHostingPermissionLevel.Minimal)]

    public class XmlWP : WebPart
    {
        Xml _Xml;

        private string _DocumentSource = "";
        [Personalizable(true)]
        [WebBrowsable(true)]
        [WebDescription("Enter path for XML document")]
        [WebDisplayName("Document source")]
        public string DocumentSource
        {
            get { return _DocumentSource; }
            set { _DocumentSource = value; }
        }

        private string _TransformSource = "";
        [Personalizable()]
        [WebBrowsable(true)]
        [WebDescription("Enter path for XSL-T document")]
        [WebDisplayName("Transform source")]
        public string TransformSource
        {
            get { return _TransformSource; }
            set { _TransformSource = value; }
        }

        protected override void CreateChildControls()
        {
            Controls.Clear();
            _Xml = new Xml();
            _Xml.DocumentSource = _DocumentSource;
            _Xml.TransformSource = _TransformSource;
            Controls.Add(_Xml);
        }
    }
}
